package com.kevin.actoviti.day02;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;

/**
 * @Classname BusinessKeyAdd
 * @Description 启动流程实例，增加businessKey
 * @Date 2020/6/22 23:26
 * @Created by kevin
 */
public class BusinessKeyAdd {

    public static void main(String[] args) {

        ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
        RuntimeService runtimeService = processEngine.getRuntimeService();
        //启动流程实例
        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("holiday", "1001");
        System.out.println(processInstance.getBusinessKey());
    }
}
